package com.maxd.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 用户会员信息表
 */
@Entity
@Getter
@Setter
@ToString
@ApiModel("用户会员信息表")
@Table(name = "user_member_record")
@DynamicInsert
@DynamicUpdate
public class UserMemberRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @ApiModelProperty("自增主键")
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty("交易流水号")
    @Column(name = "trans_id", nullable = false)
    private String transId;

    @ApiModelProperty("用户id")
    @Column(name = "user_id", nullable = false)
    private Long userId;

    @ApiModelProperty("会员ID")
    @Column(name = "member_id", nullable = false)
    private Long memberId;

    @ApiModelProperty("会员名称")
    @Column(name = "member_name", nullable = false)
    private String memberName;

    @Column(name = "price")
    @ApiModelProperty("价格")
    private BigDecimal price;

    @Column(name = "amount")
    @ApiModelProperty("支付金额")
    private BigDecimal amount;

    @Column(name = "status", nullable = false)
    @ApiModelProperty("记录状态 0-初始化 1-付款中 2-完成 3-取消")
    private String status;

    @Column(name = "pay_seq")
    @ApiModelProperty("支付流水号")
    private String paySeq;

    @ApiModelProperty("创建时间")
    @Column(name = "create_time", nullable = false)
    private Date createTime;

    @ApiModelProperty("更新时间")
    @Column(name = "update_time", nullable = false)
    private Date updateTime;

    @ApiModelProperty("创建人")
    @Column(name = "create_by")
    private String createBy;

    @ApiModelProperty("更新人")
    @Column(name = "update_by")
    private String updateBy;

}
